package modle

import (
	"github.com/jinzhu/gorm"
)

type User struct {
	gorm.Model
	Name      string `gorm:"column:name;type:varchar(64)" form:"name" form:"required"`
	LoginName string `gorm:"column:login_name;type:varchar(64)" form:"login_name" form:"required"`
	Password  string `gorm:"column:password;type:varchar(64)" form:"password" form:"required"`
	Role      int    `gorm:"column:role;type:int4" form:"role"` // 1=超级管理员，2=普通用户
	Remark    string `gorm:"column:remark;type:varchar(64)" form:"remark"`
}

func (b *User) TableName() string {
	return "user"
}
